//
//  BaseTabBarViewController.m
//  NewNest
//
//  Created by 李雪 on 16/3/9.
//  Copyright © 2016年 www.lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "BaseTabBarViewController.h"
#import "NewNestHeader.h"

@interface BaseTabBarViewController ()

@end

@implementation BaseTabBarViewController

-(instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        
        NSLog(@"%s",__FUNCTION__);
    }
    return self;
}


- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.view.backgroundColor = [UIColor whiteColor];
    
    // tarBarViewController
    [self createTabBarView];
    
    // backGroundColor
    [self configureTabBarColor];

}

// 电池栏
-(BOOL)prefersStatusBarHidden
{
    return YES;
}

-(BOOL)providesPresentationContextTransitionStyle
{
    return YES;
}

#pragma mark - 创建tabBar
-(void)createTabBarView
{
    // Choose
    ChoiceViewController *main = [[ChoiceViewController alloc]init];
    UINavigationController *mainNavi = [[UINavigationController alloc]initWithRootViewController:main];
//    mainVC.navigationBar.tintColor cyanco= [UIColor colorWithRed:140/255. green:165/255. blue:240/255. alpha:1];
    mainNavi.tabBarItem = [[UITabBarItem alloc]initWithTitle:@"Choose" image:[UIImage imageNamed:@"choice.png"] tag:1001];
    
    // Video
    VideoViewController *video = [[VideoViewController alloc]init];
    UINavigationController *videoNavi = [[UINavigationController alloc]initWithRootViewController:video];
    videoNavi.tabBarItem = [[UITabBarItem alloc]initWithTitle:@"Video" image:[UIImage imageNamed:@"video.png"] tag:1002];
    
    // Sort
    SortVC *sort = [[SortVC alloc]init];
    UINavigationController *sortNavi = [[UINavigationController alloc]initWithRootViewController:sort];
//    sort.navigationBar.tintColor = [UIColor colorWithRed:140/255. green:165/255. blue:240/255. alpha:1];
    sortNavi.tabBarItem = [[UITabBarItem alloc]initWithTitle:@"Sort" image:[UIImage imageNamed:@"sort.png"] tag:1003];
    
    // Strategy
    StrategyVC *strategy = [[StrategyVC alloc]init];
    self.stranavi = [[UINavigationController alloc]initWithRootViewController:strategy];
//    itemVC.navigationBar.tintColor = [UIColor colorWithRed:140/255. green:165/255. blue:240/255. alpha:1];
    _stranavi.tabBarItem = [[UITabBarItem alloc]initWithTitle:@"Strategy" image:[UIImage imageNamed:@"strategy.png"] tag:1004];
    
    // User
    UserVC *user = [[UserVC alloc]init];
    UINavigationController *userNavi = [[UINavigationController alloc]initWithRootViewController:user];
//    setVC.navigationBar.tintColor = [UIColor colorWithRed:140/255. green:165/255. blue:240/255. alpha:1];
    userNavi.tabBarItem = [[UITabBarItem alloc]initWithTitle:@"User" image:[UIImage imageNamed:@"user.png"] tag:1005];
    
    self.viewControllers = @[mainNavi, videoNavi,sortNavi, _stranavi, userNavi];

}

#pragma mark - tabBar/NavigationBar 颜色
-(void)configureTabBarColor
{
//    [UINavigationBar appearance].barTintColor = [UIColor colorWithRed:255/255. green:228/255. blue:225/255. alpha:1];
//    [[UITabBar appearance] setBarTintColor:[UIColor colorWithRed:255/255. green:228/255. blue:225/255. alpha:1]];
    
    
}

//#pragma mark - 禁止横屏
//-(NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
//{
//    return UIInterfaceOrientationMaskPortrait;
//}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
    if ([self isViewLoaded] && !self.view.window) {
        self.view = nil;
    }
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
